const path = require("path");

const resolve = (dir) => path.resolve(__dirname, dir);

module.exports = {
  babel: {   //用来支持装饰器
    plugins: [["@babel/plugin-proposal-decorators", { legacy: true }]]
  },
  devServer: {
    //此处用不了env环境变量
    proxy: {
      ['/dev-api']: {
        target: "http://localhost:3500",
        changeOrigin: true,
        pathRewrite: {
          ["^" + '/dev-api']: "",
        },
      },
    },
  },
  webpack: {
    alias: {
      "@": resolve("src"),
    },
  },
};
